import styles from './index.module.scss'

const EditList = ({ config, type, onClose }) => {
  const list = config[type]
  return (
    <div className={styles.root}>
      {list
        ? list.map((item) => {
            return (
              <div className="list-item" onClick={item.onClick} key={item.title}>
                {item.title}
              </div>
            )
          })
        : ''}
      <div className="list-item" onClick={onClose}>
        取消
      </div>
    </div>
  )
}
export default EditList
